<template>
  <div class="mend-list-container">
    <div class="searchBox">
      <Search
        :initData="initSearchData"
        @emitSearchData="getSearchData"
      ></Search>
    </div>
    <!-- {{initSearchData}} -->
    <div class="tableBox">
      <CustomTable :searchData="searchData"></CustomTable>
    </div>
  </div>
</template>

<script>
import CustomTable from "./components/table";
import Search from "./components/search";

export default {
  name: "ncCheckList",
  components: {
    CustomTable,
    Search
  },
  data() {
    let moment = this.$Moment;
    return {
      userName: "",
      name: "",
      role: "",
      compId: "",
      initSearchData: {
        beginTime: `${moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD')} 00:00:00`,
        endTime: `${moment(new Date()).format('YYYY-MM-DD')} 23:59:59`,
        contractCode: "",
        customerName: "",
        macSN: "",
        ipcCode: "",
        macNO: "",
        macModel: "",
        partCheckFlag: 0,
        elecModel: "",
        servoModel: "",
        rangeTime: [
        moment(new Date()).subtract(1, 'months'),
        moment(new Date())
      ]
      },
      searchData: {}
    };
  },
  methods: {
    getSearchData(value) {
      console.log(value);
      this.searchData = value;
    }
  },
  created() {
    this.searchData = this.initSearchData
  },
  mounted() {}
};
</script>

<style scoped="scoped">
.searchBox {
  margin-bottom: 16px;
}

.tableBox {
  padding: 16px;
  background-color: #ffffff;
}
</style>
